package cn.lanqiao.serviceimpl;

import javax.swing.JOptionPane;

import cn.lanqiao.dao.UserDao;
import cn.lanqiao.daoimpl.UserDaoImpl;
import cn.lanqiao.entity.Account;
import cn.lanqiao.entity.User;
import cn.lanqiao.service.UserService;

public class UserServiceImpl implements UserService{
	private UserDao userDao = new UserDaoImpl();
	@Override
	public User getUser(String UserID) {
		User user = null;
		if (UserID == null) {
			JOptionPane.showMessageDialog(null, "用户名或密码有误", "信息错误", JOptionPane.YES_NO_OPTION);
			return null;
		}
		user = userDao.getUser(UserID);
		return user;
		
	}

	@Override
	public Account enterSystem(String UserID) {
		Account account = null;
		if (UserID == null) {
			JOptionPane.showMessageDialog(null, "用户名或密码有误", "信息错误", JOptionPane.YES_NO_OPTION);
			return null;
		}
		account = this.userDao.enterSystem(UserID);
		return account;
	}
	
}
